package de.akad.imp03.timer;

import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

import javax.swing.JButton;

/**
 * "Business-Logik" hinter einer Action
 * 
 * @author wolfgang
 *
 */
public class ButtonCommand implements ActionListener {
	
	private TimeModel timeModel;
	private JButton button;
	
	public ButtonCommand(MainWindow mw, JButton button) {
		this.timeModel = mw.timeModel;
		this.button = button;
	}

	@Override
	public void actionPerformed(ActionEvent e) {
		execute();
	}
	
	public void execute() {
		timeModel.startTimer();
		button.setEnabled(false);
		
	}

}
